package com.qianxp.auth_datajpa.entity;

/**
 * @author qianxiaopeng
 */
public class AjaxJson {
    public enum codeType{
        FAIL,SUCCESS
    }
    private static final String successMsg = "操作成功!";
    private static final String failMsg = "操作失败!";

    public static final String emptyParamsMsg = "操作失败!";

    private String code;
    private String message;
    private Object data;

    public AjaxJson Success(){
        this.code = codeType.SUCCESS.name();
        this.message = successMsg;
        return this;
    }

    public AjaxJson Fail(){
        this.code = codeType.FAIL.name();
        this.message = failMsg;
        return this;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }


    public String getMessage() {
        return message;
    }

    public AjaxJson setMessage(String message) {
        this.message = message;
        return this;
    }

    public Object getData() {
        return data;
    }

    public AjaxJson setData(Object data) {
        this.data = data;
        return this;
    }
}
